﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloMVC.Test.TestHelper
{
    static class XPather
    {
    #region var static var
        private static String subIssueKepTmp = "//div[@id='ag-step-issues-{0}-{1}']/div[*]//div[contains(@class, 'ag-issue-key')]/a";
        private static String otherIssueKeyTmp = "//div[@id='ag-step-issues_{0}_orphan']/div[*]//div[contains(@class, 'ag-issue-key')]/a";
        private static String dropdownListTmp = "//ul[@id='{0}']/li[{1}]/a";
    #endregion

        /// <summary>
        /// 
        /// </summary>
        /// <param name="parentKey"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static String SubIssueKey(String parentKey, String status){
            return String.Format(subIssueKepTmp, status, parentKey);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        public static String OtherIssueKey(String status)
        {
            return String.Format(otherIssueKeyTmp, status);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="index"></param>
        public static String DropdownListText(String id, String index)
        {
            return String.Format(dropdownListTmp, id, index);
        }
    }
}
